#include <stdio.h>

int main()
{
	freopen("test.in", "r", stdin);
	freopen("test.out", "w", stdout);
	int n = 0;
	scanf("%d", &n);
	long long sum = 0;
	long long jiecheng = 1;
	for ( int i = 1; i <= n; i++ ) {
		jiecheng *= i;
		sum += jiecheng;
	}
	printf("%lld", sum);
	fclose(stdin);
	fclose(stdout);
	return 0;
}
